package chapter04.Example16;
class Animal {
    public void shout(){
        System.out.println("喵喵......");
    }
}
//Dog类
class Dog extends Animal {
    //重写shout()方法
    public void shout() {
        System.out.println("汪汪......");
    }

    public void eat() {
        System.out.println("吃骨头.......");
    }
}
    public class Example16 {
        public static void main(String[] args) {
            Animal an = new Dog();
            Dog dog = (Dog) an;
            dog.shout();
            dog.eat();
        }
    }